﻿<%@ Page Title="" Language="C#" MasterPageFile="~/master/admin.master" AutoEventWireup="true" CodeFile="quick-print.aspx.cs" Inherits="admin_quick_print" %>

<asp:Content ID="Content1" ContentPlaceHolderID="AdminHeaderContent" Runat="Server">
<script type="text/javascript" language="javascript">
    function OpenWindow() {
        var myArr = new Array();

        var myString = new String();

        myString = "1,2,3";

        myArr = myString.split(",");
        var getValues = document.getElementById("<%= hdnOrderId.ClientID %>").value.split(',');
        for (var ct = 0; ct < getValues.length; ct++) {
            var getSubValues = getValues[ct].split(':');
            if (getSubValues.length > 1) {
                for (var j = 0; j < getSubValues.length; j++) {
                    if (j < getSubValues.length - 1) {
                        //alert(getSubValues[j + 1].toString()); //call individual multi add
                        window.open("<%= SiteGlobals.BaseUrl %>"+"multiple_invoice_print.aspx?print=0&oid=" + getSubValues[j + 1].toString() + "", '_blank', "", false);
                        
                    }
                }
            }
            else {
                //alert(getValues[ct].toString()); //call regular invoice
                window.open("<%= Page.ResolveUrl(eShop.Business.CustomSiteMap.InvoicePrintPage) %>?print=0&oid=" + getValues[ct].toString() + "", '_blank', "", false);
             }
         }
//            for (var i = 0; i < myArr.length; i++) {
//                //document.write("Array Index " + i + " = " + myArr[i] + "<br />");
//                var orderId = 'JA135';
//                window.open("<%= Page.ResolveUrl(eShop.Business.CustomSiteMap.InvoicePrintPage) %>?print=0&oid=" + orderId + "", '_blank', "", false);
//            }
        window.location = "sales-ccsuccess.aspx";
    }
</script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cphMiddleContent" Runat="Server">
<asp:HiddenField ID="hdnOrderId" runat="server" />
</asp:Content>

